package com.gsnd.gsnd22estore.domain;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 日志表
 * @TableName es_log
 */
@Data
public class EsLog implements Serializable {
    /**
     * 主键ID
     */
    private Long id;

    /**
     * 操作用户
     */
    private String username;

    /**
     * 接口描述信息
     */
    private String businessName;

    /**
     * 请求接口
     */
    private String requestUrl;

    /**
     * 请求方式
     */
    private String requestMethod;

    /**
     * 系统名称
     */
    private String operationName;

    /**
     * 浏览器名称
     */
    private String browserName;

    /**
     * ip
     */
    private String ip;

    /**
     * ip来源
     */
    private String source;

    /**
     * 请求接口耗时
     */
    private Long spendTime;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 请求参数
     */
    private String paramsJson;

    /**
     * 响应参数
     */
    private String resultJson;

    /**
     * 类地址
     */
    private String classPath;

    /**
     * 方法名
     */
    private String methodName;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        EsLog other = (EsLog) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUsername() == null ? other.getUsername() == null : this.getUsername().equals(other.getUsername()))
            && (this.getBusinessName() == null ? other.getBusinessName() == null : this.getBusinessName().equals(other.getBusinessName()))
            && (this.getRequestUrl() == null ? other.getRequestUrl() == null : this.getRequestUrl().equals(other.getRequestUrl()))
            && (this.getRequestMethod() == null ? other.getRequestMethod() == null : this.getRequestMethod().equals(other.getRequestMethod()))
            && (this.getOperationName() == null ? other.getOperationName() == null : this.getOperationName().equals(other.getOperationName()))
            && (this.getBrowserName() == null ? other.getBrowserName() == null : this.getBrowserName().equals(other.getBrowserName()))
            && (this.getIp() == null ? other.getIp() == null : this.getIp().equals(other.getIp()))
            && (this.getSource() == null ? other.getSource() == null : this.getSource().equals(other.getSource()))
            && (this.getSpendTime() == null ? other.getSpendTime() == null : this.getSpendTime().equals(other.getSpendTime()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getParamsJson() == null ? other.getParamsJson() == null : this.getParamsJson().equals(other.getParamsJson()))
            && (this.getResultJson() == null ? other.getResultJson() == null : this.getResultJson().equals(other.getResultJson()))
            && (this.getClassPath() == null ? other.getClassPath() == null : this.getClassPath().equals(other.getClassPath()))
            && (this.getMethodName() == null ? other.getMethodName() == null : this.getMethodName().equals(other.getMethodName()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUsername() == null) ? 0 : getUsername().hashCode());
        result = prime * result + ((getBusinessName() == null) ? 0 : getBusinessName().hashCode());
        result = prime * result + ((getRequestUrl() == null) ? 0 : getRequestUrl().hashCode());
        result = prime * result + ((getRequestMethod() == null) ? 0 : getRequestMethod().hashCode());
        result = prime * result + ((getOperationName() == null) ? 0 : getOperationName().hashCode());
        result = prime * result + ((getBrowserName() == null) ? 0 : getBrowserName().hashCode());
        result = prime * result + ((getIp() == null) ? 0 : getIp().hashCode());
        result = prime * result + ((getSource() == null) ? 0 : getSource().hashCode());
        result = prime * result + ((getSpendTime() == null) ? 0 : getSpendTime().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getParamsJson() == null) ? 0 : getParamsJson().hashCode());
        result = prime * result + ((getResultJson() == null) ? 0 : getResultJson().hashCode());
        result = prime * result + ((getClassPath() == null) ? 0 : getClassPath().hashCode());
        result = prime * result + ((getMethodName() == null) ? 0 : getMethodName().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", username=").append(username);
        sb.append(", businessName=").append(businessName);
        sb.append(", requestUrl=").append(requestUrl);
        sb.append(", requestMethod=").append(requestMethod);
        sb.append(", operationName=").append(operationName);
        sb.append(", browserName=").append(browserName);
        sb.append(", ip=").append(ip);
        sb.append(", source=").append(source);
        sb.append(", spendTime=").append(spendTime);
        sb.append(", createTime=").append(createTime);
        sb.append(", paramsJson=").append(paramsJson);
        sb.append(", resultJson=").append(resultJson);
        sb.append(", classPath=").append(classPath);
        sb.append(", methodName=").append(methodName);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}